﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>线路订单管理</title>
    <style type="text/css">
        *
        {
            margin: 0;
            padding: 0;
        }
        .container
        {
            width: 100%;
            padding: 10px 0px 0px 10px;
        }
    </style>
    <script src="/Scripts/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script src="/Scripts/ckeditor/ckeditor_basic.js" type="text/javascript"></script>
    <script type="text/javascript">
			//<![CDATA[

        // This call can be placed at any point after the
        // <textarea>, or inside a <head><script> in a
        // window.onload event handler.

        // Replace the <textarea id="editor"> with an CKEditor
        // instance, using default configurations.
       

			//]]>
    </script>
    <script type="text/javascript">
        var cmbpkNation_TextBox1 = new Combobox('cmbpkNation_TextBox1');
        var cmbTagObject_pkNation_HiddenField1 = document.getElementById('pkNation_HiddenField1');
        cmbpkNation_TextBox1.ColumnsMapsNodeName = 'ID|Name|Value';
        cmbpkNation_TextBox1.TagObject = cmbTagObject_pkNation_HiddenField1;
        cmbpkNation_TextBox1.MustMatching = false;
        comboboxV1.SetComboboxProperty(cmbpkNation_TextBox1, 200, 200, false, 'V2', 'V1', '1', 'pkNation_TextBox1_OnTextChange', '', '');

        //文本改变查询
        function pkNation_TextBox1_OnTextChange(val) {
            val = encodeURI(val);
            var url = '/XmlData.aspx?DataType=Dict&DictKey=%e6%b0%91%e6%97%8f&searchKey=' + val + '';

            //alert(url);
            Ajax.RequestHttpXml(url, 'BindpkNation_TextBox1Data');
        }

        //绑定列表的数据
        function BindpkNation_TextBox1Data(xHttp) {
            var xml = xHttp.responseXML;

            //alert(xml.xml);
            cmbpkNation_TextBox1.DataBind(xml);
        }






        function addRow() {
            var tr = $("#tb tr").eq(1).clone();
            tr.appendTo("#tb");
        }

        //1 编辑 0 常态
        function setRowState(src, state) {
            var row = $(src).parent().parent();
            var infos = $(".info", row);

            infos.each(function (i) {
                //alert($(this).text());
                if (state == 1) {
                    var ipt = document.createElement("input");
                    ipt.type = "text";
                    ipt.className = "txt";
                    ipt.value = $(this).text();
                    $(this).text("");
                    $(this).append(ipt);
                }
                else {
                    $(this).text($(this).children().val());
                }
            });

            if (state == 1) {
                $(".btnEdit", row).hide();
                $(".btnCanelEdit", row).show();
            }
            else {
                $(".btnEdit", row).show();
                $(".btnCanelEdit", row).hide();
            }
        }

        function editRow(src) {
            setRowState(src, 1);
        }

        function saveRow(src, actionurl) {
            var objRow = $(src).parent().parent();
            var objInputs = $("input:text", objRow);
            var parm = objInputs.serialize() + "&DictKey=" + $("#DictKey").val();

            $.ajax({
                url: "/Dict/" + actionurl,
                type: "post",
                dataType: "json",
                data: parm,
                completed: function () { alert("complete") },
                success: saveRowCallback
            });
        }

        function saveRowCallback(result) {
            alert(result.ResultNo);
            alert(result.Message);
        }

        function delRow(src) {
            var row = $(src).parent().parent();
            row.remove();
        }

        function addDate(type, NumDay, ddate) {
            var date = new Date(ddate);
            type = parseInt(type) //类型 
            lIntval = parseInt(NumDay)//间隔
            switch (type) {
                case 6: //年
                    date.setYear(date.getYear() + lIntval)
                    break;
                case 7: //季度
                    date.setMonth(date.getMonth() + (lIntval * 3))
                    break;
                case 5: //月
                    date.setMonth(date.getMonth() + lIntval)
                    break;
                case 4: //天
                    date.setDate(date.getDate() + lIntval)
                    break
                case 3: //时
                    date.setHours(date.getHours() + lIntval)
                    break
                case 2: //分
                    date.setMinutes(date.getMinutes() + lIntval)
                    break
                case 1: //秒
                    date.setSeconds(date.getSeconds() + lIntval)
                    break;
                default:

            }
            return date;
        }

        function DateDiff(sDate1, sDate2) { //sDate1和sDate2是2002-12-18格式 
            var aDate, oDate1, oDate2, iDays
            aDate = sDate1.split("-")
            oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //转换为12-18-2002格式 
            aDate = sDate2.split("-")
            oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
            iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数 
            return iDays
        }

        //初始日历    defaultDate 默认日期，多个日期用,隔开
        function initCal(year, month, defaultDate) {
            var now = new Date();
            var date1 = new Date(year, month, 1);
            var date2 = addDate(5, 1, date1);

            var day = parseInt(Math.abs(date2 - date1) / 1000 / 60 / 60 / 24);

            var ulCalendar = document.getElementById("ulCalendar");
            for (var i = 1; i <= day; i++) {
                var li = document.createElement("li");
                var a = document.createElement("a");
                a.innerText = i;
                a.href = "javascript:void()";
                a.value = year + "-" + month + "-" + i;
                a.onclick = function () {
                    if ($(this).attr("class") == "selected")
                        $(this).attr("class", "");
                    else
                        $(this).attr("class", "selected");
                }

                if (defaultDate.indexOf(a.value) != -1)
                    a.className = "selected";

                li.appendChild(a);
                ulCalendar.appendChild(li);
            }

            //alert(date2 > date1);
        }

        $(function () {
            var d = "2011-7-1,2011-7-11";
            initCal(2011, 7, d);


            CKEDITOR.replace('editor1',
            { filebrowserImageUploadUrl: '/SystemSetting/CKEditorUploadImage',
                skin: 'office2003'
            }
            );
        })

        
    
    </script>
    <style type="text/css">
        #ulCalendar
        {
            list-style-type: none;
            width: 290px;
        }
        #ulCalendar li
        {
            float: left;
            width: 40px;
            height: 40px;
            background-color: Green;
            margin-right: 1px;
            margin-bottom: 1px;
        }
        #ulCalendar a
        {
            width: 100%;
            height: 100%;
            display: block;
        }
        #ulCalendar .selected
        {
            background-color: Blue;
            color: White;
        }
        #demo li
        {
            float: left;
            width: 20px;
        }
    </style>
</head>
<div>
    <form method="post" action="/data/ValidateOrderCode">
    <input name="type" type="text" />
    <input name="orderNo" type="text" />
    <input id="Submit1" type="submit" value="submit" />
    </form>
    <table id="tb1" class="tblStyle1" style="table-layout: fixed; width: 800px;">
        <thead>
            <tr>
                <th style="width: 120px; float: left;">
                    房间名
                </th>
                <th style="width: 120px;">
                    周末价格<br />
                    (组团销售价)
                </th>
                <th style="width: 120px;">
                    非周末价格
                </th>
                <th style="width: 120px;">
                    周末价格<br />
                    (地接成本价)
                </th>
                <th style="width: 120px;">
                    非周末价格
                </th>
                <th style="width: 120px;">
                    挂牌价
                </th>
                <th style="width: 120px;">
                    操作
                </th>
            </tr>
        </thead>
    </table>
    <ul style="width: 200px;" id="demo">
        <li>qweqweqwew</li><li>qweqweqwe</li><li>qwrqrqwr5</li>
        <li>1</li><li>3</li><li>5</li>
    </ul>
    <body style="width: 100%;">
        <input name="pkNation$TextBox1" type="text" value="汉族" id="pkNation_TextBox1" onclick="cmbpkNation_TextBox1.ShowList(this);"
            style="width: 100px;" />
        <input type="hidden" name="pkNation$HiddenField1" id="pkNation_HiddenField1" value="900012" />
        aaaa <span style="float: left; display: inline; background-image: url('/images/down3.png');
            width: 20px; height: 20px; border: solid 1px black;"></span>
        <ul style="list-style: none; border-bottom: 1px solid black; margin: 0; padding-bottom: 23px;">
            <li style="border-bottom: 1px solid white; background-color: White;">3333</li>
            <li>4444</li>
        </ul>
        <br />
        <div class="container">
            <table id="tb" border="1">
                <tr>
                    <td>
                        名称
                    </td>
                    <td>
                        内容
                    </td>
                    <td>
                        操作
                    </td>
                </tr>
                <tr id="tpl" class="edit">
                    <td class="info">
                        dssdfwerer
                    </td>
                    <td class="info">
                        sdfdsf
                    </td>
                    <td>
                        <a href="javascript:void(0)" onclick="editRow(this)" class="btnEdit">编辑</a> <a href="javascript:void(0)"
                            onclick="setRowState(this,0)" class="btnCanelEdit">取消编辑</a> <a href="javascript:void(0)"
                                onclick="delRow(this)">删除 </a><a href="javascript:void(0)" onclick="saveRow(this,)">
                                    保存</a>
                    </td>
                </tr>
            </table>
            <a href="javascript:addRow();">添加</a>
        </div>
        <a href="Views/dotNetFx40_Full_x86_x64.exe">花花世界</a>
    </body>
    <body style="width: 100%;">
        <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
        <ul id="ulCalendar">
        </ul>
        aaaa <span style="float: left; display: inline; background-image: url('/images/down3.png');
            width: 20px; height: 20px; border: solid 1px black;"></span>
        <ul style="list-style: none; border-bottom: 1px solid black; margin: 0; padding-bottom: 23px;">
            <li style="border-bottom: 1px solid white; background-color: White;">3333</li>
            <li>4444</li>
        </ul>
        <br />
        <div class="container">
            <table id="tb" border="1">
                <tr>
                    <td>
                        名称
                    </td>
                    <td>
                        内容
                    </td>
                    <td>
                        操作
                    </td>
                </tr>
                <tr id="tpl" class="edit">
                    <td class="info">
                        dssdfwerer
                    </td>
                    <td class="info">
                        sdfdsf
                    </td>
                    <td>
                        <a href="javascript:void(0)" onclick="editRow(this)" class="btnEdit">编辑</a> <a href="javascript:void(0)"
                            onclick="setRowState(this,0)" class="btnCanelEdit">取消编辑</a> <a href="javascript:void(0)"
                                onclick="delRow(this)">删除 </a><a href="javascript:void(0)" onclick="saveRow(this,)">
                                    保存</a>
                    </td>
                </tr>
            </table>
            <a href="javascript:addRow();">添加</a>
        </div>
        <iframe src="../Hotel/Map?HotelID=45" frameborder="0" width="100%" height="800px">
        </iframe>
    </body>
</html>
